home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_idolsilver.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  97 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_IdolSilver.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. cog        talkCog                    local
  18.  
  19. sound    foundSnd=INXJ151.wav    local
  20.  
  21. thing    player                    local
  22.  
  23. int        treasureBin=36            local
  24. int        coinBin=34                local
  25. int        value=90                local
  26.  
  27. int        bUnderwater                local
  28.  
  29. end
  30.  
  31. # ===================================================================
  32.  
  33. code
  34.  
  35. activated:
  36.  
  37.     player = GetSourceRef();
  38.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  39.  
  40.     StartCutscene(0);
  41.  
  42.     if (!bUnderwater)
  43.     {
  44.         talkCog = GetCogByIndex(0);
  45.         SendMessage(talkCog, 27);
  46.     }
  47.  
  48.     if (Rand() < 0.5)
  49.     {
  50.         SetExtCamOffset('0.15 -0.05 0.04');
  51.     }
  52.     else
  53.     {
  54.         SetExtCamOffset('-0.15 -0.05 0.04');
  55.     }
  56.     SetExtCamLookOffset('0.0 0.02 -0.01');
  57.  
  58.     return;
  59.  
  60. # -------------------------------------------------------------------
  61.  
  62. touched:
  63.  
  64.     player = GetSourceRef();
  65.  
  66.     if (GetInv(player, treasureBin) < GetInvMax(player, treasureBin))
  67.     {
  68.         TakeItem(GetSenderRef(), player);
  69.     }
  70.     else
  71.     {
  72.         EndCutscene();
  73.     }
  74.  
  75.     return;
  76.  
  77. # -------------------------------------------------------------------
  78.  
  79. taken:
  80.  
  81.     player = GetSourceRef();
  82.  
  83.     ChangeInv(player, treasureBin, value);
  84.     SetInvAvailable(player, treasureBin, 1);
  85.     JonesInvItemChanged(coinBin);
  86.  
  87.     Sleep(1.0);
  88.  
  89.     if (!bUnderwater)
  90.         PlayVoice(player, foundSnd, 1.0, 0);
  91.  
  92.     EndCutscene();
  93.  
  94.     return;
  95.  
  96. end
  97.